import {SimpleModel} from "../../framework/model/SimpleModel.ts";
import {HotMap, LineData} from "./components/HotMap.ts";

export class Land extends SimpleModel {

    threshold!: number
    step!: number

    lineSize!: number
    totalLines!: number

    // wave! : WaveMesh
    wave!: HotMap

    constructor() {
        super("Land")
        this.init()
    }

    changeSize(horizonThreshold: number, altitudeStep: number, lineSize: number, totalLines: number) {
        this.wave = new HotMap()
        this.threshold = horizonThreshold
        this.step = altitudeStep
        this.lineSize = lineSize
        this.totalLines = totalLines
        this.wave.init(this.totalLines, this.lineSize, this.threshold, this.step)
        this.scene?.add(this.wave.mesh)
    }
    setPointsFilter(size: number) {
        this.wave.setPointsFilter(size)
    }

    init() {
        // this.wave = new HotMap()
        //this.wave.changeSize(this.totalLines, this.lineSize, this.threshold, this.step)
        // this.scene?.add(this.wave.mesh)
    }

    pushLines(lines: LineData[]) {
        this.wave.addLine(lines)
    }
}